home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / lfs / lfsStats.h < prev    next >
C/C++ Source or Header  |  1991-01-09  |  9KB  |  224 lines

  1. /*
  2.  * lfsStats.h --
  3.  *
  4.  *    Declarations of Lfs stats structure.
  5.  *
  6.  * Copyright 1990 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  * $Header: /sprite/src/kernel/lfs/RCS/lfsStats.h,v 1.3 91/01/09 12:18:04 mendel Exp $ SPRITE (Berkeley)
  16.  */
  17.  
  18. #ifndef _LFS_STATS
  19. #define _LFS_STATS
  20.  
  21. /* constants */
  22.  
  23. #define    LFS_STATS_VERSION 1
  24.  
  25. typedef struct LfsStatsCounter {
  26.     unsigned int high;    /* High 32 bits. */
  27.     unsigned int low;    /* Low 32 bits. */
  28. } LfsStatsCounter; 
  29.  
  30. #define LFS_STATS_MAX_SIZE    4096
  31. #define    LFS_STATS_CDIST_BUCKETS    64
  32. #ifdef LFS_STATS_COLLECT
  33. #define    LFS_STATS_INC(counter)    ((++(counter).low == 0) ? (counter).high++ : 0)
  34. #define    LFS_STATS_ADD(counter, count)    \
  35.     ((((counter).low + (count) < (counter).low) ? (counter).high++ : 0),\
  36.         ((counter).low = (counter).low + (count)))
  37. #else
  38. #define    LFS_STATS_INC(counter)    
  39. #define    LFS_STATS_ADD(counter, count)
  40. #endif
  41. /* data structures */
  42. #define LFSCOUNT LfsStatsCounter
  43. typedef struct Lfs_StatsVersion1 {
  44.     int    version;    /* Version number of stats structure. */
  45.     int    size;        /* Size of this structure in bytes. */
  46.     /*
  47.      * Segmented log counts.
  48.      */
  49.     struct LfsLogStats {
  50.     LFSCOUNT segWrites;     /* Number of segmetns writes. */
  51.     LFSCOUNT partialWrites; /* Number of non-full segment writes. */
  52.     LFSCOUNT emptyWrites;   /* Number of empty segment writes. */
  53.     LFSCOUNT blocksWritten; /* Number of blocks written to the log.*/
  54.     LFSCOUNT bytesWritten;   /* Number of active bytes written to the log.*/
  55.     LFSCOUNT summaryBlocksWritten; /* Number of summary blocks written to 
  56.                        * disk. */
  57.     LFSCOUNT summaryBytesWritten; /* Number of summary bytes written. */
  58.     LFSCOUNT wasteBlocks;      /* Number of waste blocks. */
  59.     LFSCOUNT newSegments;      /* Number of new segments requests. */
  60.     LFSCOUNT cleanSegWait;     /* Number of waits for a clean segment. */
  61.     LFSCOUNT useOldSegment;    /* Number of requests that could use old 
  62.                         * segment. */
  63.     LFSCOUNT locks;          /* Number of log was locked. */
  64.     LFSCOUNT lockWaits;   /* Number time we waited to lock log. */
  65.     LFSCOUNT padding[16];
  66.     } log;
  67.     /*
  68.      * Checkpoint related counters
  69.      */
  70.     struct LfsCheckPointStats {
  71.     LFSCOUNT count;       /* Number of checkpoints performed. */
  72.     LFSCOUNT segWrites;     /* Number of seg writes during checkpoints. */
  73.     LFSCOUNT blocksWritten; /* Number of log writes during checkpoints. */
  74.     LFSCOUNT bytesWritten; /* Number of bytes written during 
  75.                 * checkpoints. */
  76.     LFSCOUNT totalBlocks; /* Total blocks written to checkpoint area. */
  77.     LFSCOUNT totalBytes;  /* Total bytes written to checkpoint area. */
  78.     LFSCOUNT padding[16];
  79.     } checkpoint;
  80.  
  81.  
  82.     struct LfsLogCleanStats {
  83.     LFSCOUNT startRequests;    /* Number of start cleaning calls. */
  84.     LFSCOUNT alreadyActive;    /* Number of start calls with cleaning 
  85.                  * already active. */
  86.     LFSCOUNT getSegsRequests; /* Number of request to LfsGetSegsToClean */
  87.     LFSCOUNT segsToClean;        /* Number of segs returned to clean. */
  88.     LFSCOUNT numSegsToClean;    /* Number of segments return. */
  89.     LFSCOUNT segReads;        /* Number of segment read in. */
  90.     LFSCOUNT readErrors;            /* Number we got errors reading in. */
  91.     LFSCOUNT readEmpty;        /* Number we found to be empty. */
  92.     LFSCOUNT bytesCleaned;        /* Number of active bytes cleaned. */
  93.     LFSCOUNT cacheBlocksUsed;    /* Number of cache blocks used. */
  94.     LFSCOUNT segWrites;       /* Number of seg writes during cleaning. */
  95.     LFSCOUNT blocksWritten; /* Number of log writes during cleaning. */
  96.     LFSCOUNT bytesWritten;      /* Number of bytes written during 
  97.                 * cleaning. */
  98.     LFSCOUNT summaryBlocksRead;    /* Number of summary blocks read. */
  99.  
  100.     LFSCOUNT padding[16];
  101.     } cleaning;
  102.  
  103.     struct LfsBlockIOStats {
  104.     LFSCOUNT reads;    /* Number of block read. */
  105.     LFSCOUNT bytesReads;    /* Number of bytes read. */
  106.     LFSCOUNT allocs;        /* Calls to Lfs_BlockAllocate. */
  107.     LFSCOUNT fastAllocs;        /* Number fast allocs. */
  108.     LFSCOUNT slowAllocs;        /* Number of slow allocs. */
  109.     LFSCOUNT slowAllocFails; /* Number of slow allocs that failed. */
  110.     LFSCOUNT totalBytesRead; /* Total bytes read. */
  111.     LFSCOUNT totalBytesWritten; /* Total number of bytes written. */
  112.     LFSCOUNT segCacheHits;        /* Reads that hit in the seg cache. */
  113.     LFSCOUNT padding[15];
  114.     } blockio;
  115.  
  116.     struct LfsDescStats {
  117.     LFSCOUNT fetches;    /* Number of descriptor fetches. */
  118.     LFSCOUNT goodFetch;  /* Number of fetches that succed. */
  119.     LFSCOUNT fetchCacheMiss; /* Fetches that missed in the cache. */
  120.     LFSCOUNT fetchSearched;  /* Number of descriptors searched during ftetch. */
  121.     LFSCOUNT stores;    /* Number of descriptor stores. */
  122.     LFSCOUNT freeStores;    /* Number of stores of free descriptors. */
  123.     LFSCOUNT accessTimeUpdate; /* Number of access time updates. */
  124.     LFSCOUNT dirtyList;          /* File put on dirty list. */
  125.     LFSCOUNT truncs;    /* Descriptor truncates. */
  126.     LFSCOUNT truncSizeZero;    /* Truncate to size zero. */
  127.     LFSCOUNT delete;    /* Truncate with delete. */
  128.     LFSCOUNT inits;    /* Descriptor init calls. */
  129.     LFSCOUNT getNewFileNumber; /* Number of calls for getNewFileNumber */
  130.     LFSCOUNT scans;          /* Scans during getNewFileNumber */
  131.     LFSCOUNT free;          /* Number of descriptor frees. */
  132.     LFSCOUNT mapBlocksWritten; /* Descriptor map blocks written. */
  133.     LFSCOUNT mapBlockCleaned;  /* Map blocks cleaned. */
  134.     LFSCOUNT descMoved;          /* Number of descriptor that move. */
  135.     LFSCOUNT padding[16];
  136.     } desc;
  137.     struct LfsIndexStats {
  138.     LFSCOUNT    get;    /* Get file index count. */
  139.     LFSCOUNT    set;    /* Set file index count. */
  140.     LFSCOUNT getFetchBlock; /* Number of indirect blocks fetched by get.*/
  141.     LFSCOUNT setFetchBlock; /* Number of indirect blocks fetched by set. */
  142.     LFSCOUNT growFetchBlock; /* Number of indirect blocks fetched by grow */
  143.     LFSCOUNT getFetchHit; /* Number of indirect blocks found in cache for 
  144.                   * get. */
  145.     LFSCOUNT setFetchHit; /* Number of indirect blocks found in cache for
  146.                   * set. */
  147.     LFSCOUNT truncs; /* Truncate index count. */
  148.     LFSCOUNT deleteFetchBlock; /* Fetching a cache block for delete. */
  149.     LFSCOUNT deleteFetchBlockMiss; /* Reading a cache block for delete. */
  150.     LFSCOUNT padding[16];
  151.     } index;
  152.  
  153.     struct LfsFileLayoutStats {
  154.     LFSCOUNT calls;    /* Calls to LfsFileLayoutProc. */
  155.     LFSCOUNT dirtyFiles; /* Number of dirty files fetched. */
  156.     LFSCOUNT dirtyBlocks; /* Number of dirty blocks fetched. */
  157.     LFSCOUNT dirtyBlocksReturned; /* Number of dirty blocks returned. */
  158.     LFSCOUNT filledRegion; /* Number of times we filled a region. */
  159.     LFSCOUNT segWrites;      /* Number writes of file data. */
  160.     LFSCOUNT cacheBlocksWritten;      /* Number of cache block written. */
  161.     LFSCOUNT descBlockWritten;    /* Number of descriptor blocks written. */
  162.     LFSCOUNT descWritten;      /* Number of descriptor written. */
  163.     LFSCOUNT filesWritten;      /* Number of files written. */
  164.     LFSCOUNT cleanings;      /* Number of file layout cleans. */
  165.     LFSCOUNT descBlocksCleaned; /* Number of descriptor blocks we had to 
  166.                  * clean. */
  167.     LFSCOUNT descCleaned; /* Number of descriptors cleaned. */
  168.     LFSCOUNT descCopied;    /* Number of descriptors copied during cleaning. */
  169.     LFSCOUNT fileCleaned; /* Number of files encounted during cleaning. */
  170.     LFSCOUNT fileVersionOk; /* Number of files encounted during cleaning that
  171.                 * could be alive by version number ok. */
  172.     LFSCOUNT blocksCleaned; /* Number of blocks encounted during 
  173.                 * cleaning. */
  174.     LFSCOUNT blocksCopied;  /* Number of blocks copied during cleaning. */
  175.     LFSCOUNT blocksCopiedHit; /* Number of blocks founding in cache 
  176.                   * during cleaning. */
  177.     LFSCOUNT cleanNoHandle;    /* Files deleted while being cleaned. */
  178.     LFSCOUNT cleanLockedHandle; /* File cleaning failed due to locked 
  179.                      * handle. */
  180.  
  181.     LFSCOUNT padding[14];
  182.     } layout;
  183.  
  184.     struct LfsSegUsageStats {
  185.     LFSCOUNT blocksFreed; 
  186.     LFSCOUNT bytesFreed;
  187.     LFSCOUNT usageSet;
  188.     LFSCOUNT blocksWritten;
  189.     LFSCOUNT blocksCleaned;
  190.     LFSCOUNT padding[16];
  191.     } segusage;
  192.  
  193.     struct LfsCacheBackendStats {
  194.     LFSCOUNT startRequests;    /* Number of start write-back calls. */
  195.     LFSCOUNT alreadyActive;    /* Number of start calls with write-back 
  196.                  * already active. */
  197.     LFSCOUNT padding[16];
  198.     } backend;
  199.  
  200.     struct LfsDirLogStats {
  201.     LFSCOUNT entryAllocNew;      /* Number of calls to LfsDirLogEntryAlloc for
  202.                    * new entry. */
  203.     LFSCOUNT entryAllocOld;      /* Number of calls to LfsDirLogEntryAlloc for
  204.                    * old entry. */
  205.     LFSCOUNT entryAllocFound; /* Number of calls to LfsDirLogEntryAlloc that
  206.                    * found their entry. */
  207.     LFSCOUNT entryAllocWaits; /* Number of waits in LfsDirLogEntryAlloc. */
  208.     LFSCOUNT newLogBlock; /* Number of new block blocks fetched. */
  209.     LFSCOUNT fastFindFail; 
  210.     LFSCOUNT findEntrySearch;
  211.     LFSCOUNT dataBlockWritten;
  212.     LFSCOUNT blockWritten;
  213.     LFSCOUNT bytesWritten;
  214.     LFSCOUNT padding[2];
  215.     } dirlog;
  216.     unsigned int cleaningDist[LFS_STATS_CDIST_BUCKETS];
  217. } Lfs_StatsVersion1;
  218. #undef LFSCOUNT
  219.  
  220. typedef Lfs_StatsVersion1 Lfs_Stats;
  221.  
  222. #endif /* _LFS_STATS */
  223.  
  224.